const banners = require('./src/mock/json/banners.json') 
const path = require('path');
function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    outputDir: "dist",
    lintOnSave: false,
    devServer: {
        open: true,
        proxy:{
            '/api':{
                target:'http://182.92.128.115'
            }
        },
        // before(app){
        //     console.log(1111111111)
        //     // app.get('/banners', (req, res)=>{
        //     //     res.json({data:banners,code:200})
        //     // }),
        //     app.get("/banners",(req,res)=>{res.json({ data: banners,code:200})});
        // }
    },
    
    configureWebpack: {
        resolve: {
            alias: {
                components: resolve('src/components'),
                http: resolve('src/http'),
                pages: resolve('src/pages'),
                router: resolve('src/router'),
                routes: resolve('src/routes'),
                store: resolve('src/store'),
                mock: resolve('src/mock'),
                common: resolve('src/common'),
                util: resolve('src/util'),
                config: resolve('src/config')
            }
        }
    }
}
